package com.mingqi.enetconnected.view.Dialog.single;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mingqi.enetconnected.R;
import com.mingqi.enetconnected.util.date.DateTimeInfo;
import com.mingqi.enetconnected.view.BorderRadioButton;

import java.util.List;

public class ChooseTimeAdapter extends BaseQuickAdapter<DateTimeInfo, BaseViewHolder> {
    public ChooseTimeAdapter(@Nullable List<DateTimeInfo> data) {
        super(R.layout.item_choose_time, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, DateTimeInfo item) {
        helper.setText(R.id.choose_value, item.getValue()).addOnClickListener(R.id.choose_value);
        BorderRadioButton borderRadioButton = helper.getView(R.id.choose_value);
        borderRadioButton.setChecked(item.isChecked());
    }

    @Override
    public String toString() {
        String ss = "";
        for (DateTimeInfo dto : getData()) {
            ss += dto.getValue() + ",";
        }
        return "ChooseTimeAdapter{" + ss + "}";
    }
}
